package euclid_filtros;


import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.util.LinkedList;
import java.util.List;


/**
 * This class demonstrates how to load an Image from an external file
 */
public class ImagePanel extends Component {


    BufferedImage img;


    public BufferedImage getImg() {
        return img;
    }

    public void setImg(BufferedImage img) {
        this.img = img;
    }

    @Override
    public void paint(Graphics g) {
        g.drawImage(img, 0, 0, null);
    }



    @Override
    public Dimension getPreferredSize() {
        if (img == null) {
             return new Dimension(100,100);
        } else {
           return new Dimension(img.getWidth(), img.getHeight());
       }
    }


}
